<!--
 ______________
< EDLad.com >
 --------------
        \   ^__^
         \  (**)\__$__$__
            (__)\       )\/\
             U  ||------|
                ||     ||
-->
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>Ubuntu 下安装和配置 Homebrew | ED少年 - 王文宏的博客</title>
  <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
  <meta name="keywords" content="ED少年,ED,CSS,CSS3,SASS,Javascript,jQuery,Linux,Ubuntu,NodeJS,MongoDB,Mac">
  <meta name="description" content="这是 Eded 的个人博客，他的精神在这里驻扎生根，未成年人请在监护人陪同下游览。ED 是一名经验丰富的 CSSer，写博客的目的主要是记录工作中遇到的问题。">
  <link rel="stylesheet" href="/css/main.css">
</head>

<body >
  <svg style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-nature" viewBox="0 0 32 32">
<title>nature</title>
<path class="path1" d="M18.667 9.333c0-1.467-1.2-2.667-2.667-2.667s-2.667 1.2-2.667 2.667 1.2 2.667 2.667 2.667 2.667-1.2 2.667-2.667zM14.667 9.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333-0.533 1.333-1.333 1.333-1.333-0.533-1.333-1.333z"></path>
<path class="path2" d="M17.333 22.267v-4c0.8-0.4 1.333-1.333 1.333-2.267v-0.267l0.133 0.133c1.067 1.067 2.667 1.067 3.733 0s1.067-2.667 0-3.733l-0.133-0.133h0.267c1.467 0 2.667-1.2 2.667-2.667s-1.2-2.667-2.667-2.667h-0.267l0.133-0.133c1.067-1.067 1.067-2.667 0-3.733s-2.667-1.067-3.733 0l-0.133 0.133v-0.267c0-1.467-1.2-2.667-2.667-2.667s-2.667 1.2-2.667 2.667v0.267l-0.133-0.133c-1.067-1.067-2.667-1.067-3.733 0s-1.067 2.667 0 3.733l0.133 0.133h-0.267c-1.467 0-2.667 1.2-2.667 2.667s1.2 2.667 2.667 2.667h0.267l-0.267 0.133c-1.067 1.067-1.067 2.667 0 3.733s2.667 1.067 3.733 0l0.133-0.133v0.267c0 0.933 0.533 1.867 1.333 2.267v4c-1.333-2.133-3.733-3.6-6.533-3.6h-1.333v5.333c0 4.4 3.6 8 8 8h2.667c4.4 0 8-3.6 8-8v-5.333h-1.333c-2.8 0-5.2 1.467-6.667 3.6zM13.333 13.867l-1.067 1.067c-0.533 0.533-1.333 0.533-1.867 0s-0.533-1.333 0-1.867l1.067-1.067c-0.267-0.4-0.533-0.8-0.667-1.333h-1.467c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h1.467c0.133-0.533 0.267-0.933 0.533-1.333l-0.933-1.067c-0.533-0.533-0.533-1.333 0-1.867s1.333-0.533 1.867 0l1.067 1.067c0.4-0.267 0.933-0.4 1.333-0.533v-1.6c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v1.467c0.533 0.133 0.933 0.267 1.333 0.533l1.067-1.067c0.533-0.533 1.333-0.533 1.867 0s0.533 1.333 0 1.867l-1.067 1.2c0.267 0.4 0.4 0.933 0.533 1.333h1.6c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-1.467c-0.133 0.533-0.267 0.933-0.533 1.333l1.067 1.067c0.533 0.533 0.533 1.333 0 1.867s-1.333 0.533-1.867 0l-1.2-1.067c-0.4 0.267-0.933 0.4-1.333 0.533v1.6c0 0.8-0.533 1.333-1.333 1.333s-1.333-0.533-1.333-1.333v-1.467c-0.533-0.133-0.933-0.4-1.333-0.667zM14.667 30.667c-3.733 0-6.667-2.933-6.667-6.667v-4c3.733 0 6.667 2.933 6.667 6.667v4zM24 24c0 3.733-2.933 6.667-6.667 6.667v-4c0-3.733 2.933-6.667 6.667-6.667v4z"></path>
</symbol>
<symbol id="icon-book" viewBox="0 0 32 32">
<title>book</title>
<path class="path1" d="M31.434 8.421h-0.029c-0.548 0.004-0.633-0.473-0.642-0.694v-3.457c0-0.369-0.299-0.668-0.667-0.668h-9.883c-2.48 0-3.404 0.919-3.634 1.208l-0.063 0.088-0 0.002-0.195 0.268c-0 0-0 0-0 0-0.262 0.361-0.491 0.207-0.601 0.089l-0.374-0.466-0.185-0.223c-0.311-0.327-1.121-0.964-2.728-0.964h-10.528c-0.369 0-0.668 0.299-0.668 0.668v3.413c0 0.598-0.325 0.717-0.523 0.738h-0.148c-0.162 0.010-0.539 0.104-0.539 0.797v16.265c0 0.399 0.324 0.722 0.723 0.722h9.609c3.066 0 4.402 1.156 4.802 1.599l0.229 0.283h0.001c0 0 0.613 0.694 1.259 0v0l0.134-0.157v0l0.002-0.002 0.171-0.2c0.005-0.006 0.046-0.052 0.105-0.113 0.512-0.497 1.79-1.412 4.29-1.412h9.902c0.399 0 0.723-0.323 0.723-0.722v-16.422c0-0.588-0.425-0.637-0.54-0.64zM29.276 22.931c0 0.32-0.267 0.579-0.601 0.579h-8.148c-2.899 0-3.952 1.31-3.952 1.31l-0.134 0.179-0.063 0.087c-0 0-0 0-0 0-0.276 0.375-0.683 0.003-0.685 0.001l-0.188-0.235c-0.139-0.167-1.204-1.343-3.781-1.343h-8.4c-0.332 0-0.599-0.259-0.599-0.579v-17.331c0-0.32 0.268-0.579 0.599-0.579h6.521c4.851 0 5.31 2.756 5.342 3.556v12.053c0 0.876 0.418 1.041 0.653 1.064h0.35c0.24-0.024 0.622-0.166 0.622-0.85v-12.423h-0.004c0.036-1.002 0.427-3.401 3.345-3.401h8.521c0.333 0 0.601 0.259 0.601 0.579v17.332z"></path>
</symbol>
<symbol id="icon-bug" viewBox="0 0 32 32">
<title>bug</title>
<path class="path1" d="M16-0.092c-2.867 0-5.24 2.115-5.641 4.874h11.281c-0.401-2.759-2.773-4.874-5.641-4.874z"></path>
<path class="path2" d="M11.77 6.253h-3.669l-2.261-3.785c-0.241-0.403-0.668-0.629-1.106-0.629-0.225 0-0.452 0.059-0.659 0.183-0.61 0.365-0.809 1.157-0.445 1.768l3.010 5.038h2.001c-2.093 1.789-3.562 4.314-3.943 7.172h-2.859c-0.508 0-0.92 0.412-0.92 0.92v0.552c0 0.508 0.412 0.92 0.92 0.92h2.8c0.209 2.531 1.27 4.826 2.874 6.621h-0.872l-3.010 5.036c-0.365 0.61-0.166 1.401 0.444 1.766 0.207 0.124 0.435 0.182 0.659 0.182 0.438 0 0.865-0.224 1.106-0.627l2.261-3.783h2.715c1.31 0.685 2.754 1.123 4.265 1.247v-22.58h-3.31z"></path>
<path class="path3" d="M30.161 16h-2.855c-0.367-2.859-1.79-5.384-3.869-7.172h2.003l3.013-4.883c0.374-0.605 0.186-1.399-0.419-1.773s-1.398-0.184-1.772 0.421l-2.258 3.66h-7.084v22.58c1.559-0.124 3.027-0.562 4.344-1.247h2.74l2.258 3.658c0.373 0.605 1.166 0.793 1.772 0.419s0.793-1.167 0.419-1.772l-3.012-4.88h-0.885c1.583-1.794 2.607-4.090 2.809-6.621h2.798c0.508 0 0.92-0.412 0.92-0.92v-0.552c0-0.508-0.412-0.92-0.92-0.92z"></path>
</symbol>
<symbol id="icon-burger" viewBox="0 0 32 32">
<title>burger</title>
<path class="path1" d="M22.667 5.333h-13.333c-5.2 0-9.333 4.133-9.333 9.333v13.333c0 2.267 1.733 4 4 4h24c2.267 0 4-1.733 4-4v-13.333c0-5.2-4.133-9.333-9.333-9.333zM2.667 17.333h11.733l2.667 2.667h-14.4v-2.667zM16.4 17.333h9.6l-4.8 4.8-4.8-4.8zM29.333 28c0 0.8-0.533 1.333-1.333 1.333h-24c-0.8 0-1.333-0.533-1.333-1.333v-1.333h26.667v1.333zM29.333 25.333h-26.667v-2.667h17.067l1.333 1.333 1.333-1.333h6.933v2.667zM29.333 20h-4.133l2.667-2.667h1.467v2.667zM29.333 16h-26.667v-1.333c0-3.733 2.933-6.667 6.667-6.667h13.333c3.733 0 6.667 2.933 6.667 6.667v1.333z"></path>
<path class="path2" d="M22.667 12c0 0.736-0.597 1.333-1.333 1.333s-1.333-0.597-1.333-1.333c0-0.736 0.597-1.333 1.333-1.333s1.333 0.597 1.333 1.333z"></path>
<path class="path3" d="M16 10.667c0 0.736-0.597 1.333-1.333 1.333s-1.333-0.597-1.333-1.333c0-0.736 0.597-1.333 1.333-1.333s1.333 0.597 1.333 1.333z"></path>
<path class="path4" d="M10.667 12c0 0.736-0.597 1.333-1.333 1.333s-1.333-0.597-1.333-1.333c0-0.736 0.597-1.333 1.333-1.333s1.333 0.597 1.333 1.333z"></path>
</symbol>
<symbol id="icon-costumes" viewBox="0 0 32 32">
<title>costumes</title>
<path class="path1" d="M32.014 9.44c-0.085-5.66-4.878-5.369-4.878-5.369-0.368 0.006-4.321 0.165-4.344 3.888-0.002 0.018 0 0.039-0.002 0.057v0.011c-0.003 0.181 0.002 0.413 0.012 0.669l-0.003 0.002v1.52c-0.002 0.011-0.006 0.019-0.009 0.030-0.002 0.209-0.005 0.406-0.005 0.59h-0c0 0 0.009 0.98-0.523 1.407-0.067 0.044-0.133 0.091-0.208 0.123-0.027 0.011-0.058 0.018-0.087 0.026-0.113 0.036-0.23 0.063-0.354 0.063-0.656 0-1.187-0.531-1.187-1.186 0-0.019 0.006-0.034 0.006-0.052 0-0.007-0.002-0.010-0.002-0.018v-1.817h-0.002v-0.001c0-0.392-0.32-0.71-0.71-0.71-0.393 0-0.711 0.319-0.711 0.71v2.060c0 1.746 1.59 2.316 1.909 2.412 0.267 0.047 0.55 0.079 0.86 0.079 1.505-0.037 2.163-1.235 2.427-1.976 0.003-0.006 0.006-0.013 0.009-0.021 0.007-0.021 0.015-0.056 0.024-0.082 0.018-0.053 0.033-0.104 0.047-0.149 0.006-0.024 0.013-0.045 0.020-0.071 0.041-0.155 0.056-0.252 0.056-0.252l-0.002-0.001c0.063-0.318 0.114-0.725 0.119-1.26v-1.224c0-0.145 0.011-0.273 0.019-0.402-0.005-0.062-0.019-0.119-0.019-0.181 0-1.502 1.219-2.72 2.72-2.72 1.482 0 2.68 1.184 2.715 2.656h0.006v0.052c0 0.004 0.002 0.008 0.002 0.012s-0.002 0.008-0.002 0.012v1.973c0.002 0.030 0.009 0.058 0.009 0.088h0.006v0.11c0 0.024 0.005 0.049 0.005 0.075 0 0.013-0.005 0.025-0.005 0.039v4.626c0 1.102-0.78 1.090-1.1 1.041-0.849-0.177-1.574-0.448-1.574-0.448l0.012 0.021c-0.892-0.302-1.862-0.482-2.886-0.482-1.47 0-2.832 0.351-3.996 0.943l-0.005-0.009c0 0-0.032 0.020-0.082 0.052-0.235 0.125-0.46 0.259-0.677 0.401-0.898 0.5-2.426 1.23-3.688 1.236-1.864-0.030-3.816-1.41-3.816-1.41v0.011c-1.263-0.764-2.816-1.224-4.505-1.224-0.872 0-1.704 0.132-2.484 0.354v-0.013c0 0-1.327 0.418-2.582 0.615-0.679 0.127-0.77-0.403-0.779-0.633v-4.471c0-0.011-0.004-0.023-0.004-0.034 0-0.021 0.003-0.043 0.004-0.064v-0.094h0.004c0.002-0.025 0.006-0.050 0.008-0.074v-1.693c0-0.005-0-0.007-0-0.011 0-0.003 0-0.008 0-0.011v-0.044h0.004c0.030-1.264 1.058-2.279 2.329-2.279 1.29 0 2.333 1.044 2.333 2.333 0 0.053-0.011 0.102-0.015 0.155 0.007 0.111 0.015 0.222 0.015 0.345v1.052c0.003 0.459 0.048 0.809 0.103 1.081l-0.003 0.001c0 0 0.014 0.084 0.050 0.217 0.006 0.022 0.011 0.040 0.018 0.061 0.011 0.040 0.026 0.082 0.040 0.129 0.007 0.021 0.015 0.050 0.021 0.069 0.003 0.005 0.005 0.013 0.008 0.019 0.227 0.636 0.792 1.662 2.082 1.694 0.265 0 0.508-0.027 0.737-0.068 0.274-0.084 1.639-0.572 1.639-2.070v-1.768h-0.030c0.002-0.020 0.011-0.037 0.011-0.058 0-0.332-0.27-0.601-0.601-0.601s-0.601 0.27-0.601 0.601c0 0.021 0.009 0.039 0.011 0.058h-0.011v1.559c0 0.006-0.002 0.009-0.002 0.014 0.001 0.015 0.005 0.029 0.005 0.044 0 0.562-0.456 1.018-1.018 1.018-0.107 0-0.208-0.024-0.304-0.055-0.024-0.008-0.050-0.013-0.073-0.023-0.065-0.026-0.121-0.066-0.179-0.105-0.457-0.365-0.449-1.206-0.449-1.206v0c-0.002-0.158-0.003-0.328-0.005-0.507-0.002-0.009-0.006-0.017-0.008-0.025v-1.303l-0.002-0.002c0.008-0.22 0.013-0.418 0.010-0.574v-0.010c0-0.016 0-0.034-0-0.049-0.019-3.194-3.41-3.33-3.727-3.336 0 0-4.113-0.25-4.186 4.605h-0.006v10.927c0 1.249 0.245 2.115 0.459 2.64 1.063 2.418 3.873 4.148 7.178 4.148 3.138 0 5.825-1.558 6.999-3.784l0.002 0.002c0 0 0.009-0.017 0.016-0.033 0.009-0.017 0.018-0.033 0.026-0.050 0.126-0.244 0.557-0.982 1.214-0.982h0.127c0.717-0.002 1.153 0.633 1.325 0.943 0.020 0.044 0.042 0.084 0.064 0.125 0.012 0.026 0.020 0.044 0.020 0.044l0.003-0.003c1.186 2.201 3.857 3.739 6.974 3.739 2.975 0 5.549-1.399 6.809-3.44 0.203-0.343 0.827-1.5 0.827-2.839v-12.213h-0.007zM3.893 20.543c3.903-4.526 8.595 0.228 8.595 0.228-3.155 4.172-7.348 1.931-8.595-0.228zM19.512 20.771c0 0 4.692-4.754 8.595-0.228-1.247 2.159-5.44 4.401-8.596 0.228z"></path>
</symbol>
<symbol id="icon-doctors" viewBox="0 0 32 32">
<title>doctors</title>
<path class="path1" d="M27.619 1.778c-3.345-2.733-8.274-2.237-11.009 1.109l-13.339 16.326c-2.734 3.345-2.239 8.276 1.108 11.009s8.276 2.239 11.011-1.108l13.339-16.327c2.734-3.346 2.238-8.275-1.109-11.009zM15.948 24.547l-1.46 1.787c-1.973 2.416-5.585 2.727-8.069 0.698-0.154-0.126-0.297-0.259-0.435-0.397-0.266-0.328 0.17-0.402 0.17-0.402l0.005-0.010c1.541 0.206 5.622 0.434 9.412-2.104l0.006 0.015c0 0 0.207-0.090 0.307 0 0.1 0.091 0.17 0.284 0.065 0.413zM27.121 12.066l-2.286 2.799c-0.043 0.056-0.080 0.115-0.125 0.171l-2.852 3.492-9.377-7.397 5.403-6.611c2.084-2.551 5.843-2.929 8.393-0.845 2.552 2.084 2.929 5.842 0.845 8.393z"></path>
</symbol>
<symbol id="icon-hospital" viewBox="0 0 32 32">
<title>hospital</title>
<path class="path1" d="M30.667 10.667h-5.333v-9.333c0-0.8-0.933-1.333-1.6-1.333h-16c-0.8 0-1.067 0.533-1.067 1.333v9.333h-5.333c-0.8 0-1.333 0.533-1.333 1.333v20h32v-20c0-0.8-0.533-1.333-1.333-1.333zM18.667 29.333h-5.333v-5.333h5.333v5.333zM29.333 29.333h-9.333v-6.667h-8v6.667h-9.333v-16h6.667v-10.667h13.333v10.667h6.667v16z"></path>
<path class="path2" d="M17.333 17.333h2.667v2.667h-2.667v-2.667z"></path>
<path class="path3" d="M12 17.333h2.667v2.667h-2.667v-2.667z"></path>
<path class="path4" d="M6.667 17.333h2.667v2.667h-2.667v-2.667z"></path>
<path class="path5" d="M22.667 17.333h2.667v2.667h-2.667v-2.667z"></path>
<path class="path6" d="M22.667 22.667h2.667v2.667h-2.667v-2.667z"></path>
<path class="path7" d="M6.667 22.667h2.667v2.667h-2.667v-2.667z"></path>
<path class="path8" d="M17.333 5.333h-2.667v2.667h-2.667v2.667h2.667v2.667h2.667v-2.667h2.667v-2.667h-2.667z"></path>
</symbol>
<symbol id="icon-office" viewBox="0 0 32 32">
<title>office</title>
<path class="path1" d="M30.533 1.333h-6.533c0-0.8-0.533-1.333-1.333-1.333s-1.333 0.533-1.333 1.333h-10.667c0-0.8-0.533-1.333-1.333-1.333s-1.333 0.533-1.333 1.333h-6.533c-0.8 0-1.467 0.667-1.467 1.467v27.733c0 0.8 0.667 1.467 1.467 1.467h29.067c0.8 0 1.467-0.667 1.467-1.467v-27.733c0-0.8-0.667-1.467-1.467-1.467zM29.333 29.333h-26.667v-18.667h26.667v18.667zM29.333 9.333h-26.667v-5.333h5.333v1.333c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-1.333h10.667v1.333c0 0.8 0.533 1.333 1.333 1.333s1.333-0.533 1.333-1.333v-1.333h5.333v5.333z"></path>
<path class="path2" d="M10.667 13.333h-5.333v5.333h5.333v-5.333zM9.333 17.333h-2.667v-2.667h2.667v2.667z"></path>
<path class="path3" d="M18.667 13.333h-5.333v5.333h5.333v-5.333zM17.333 17.333h-2.667v-2.667h2.667v2.667z"></path>
<path class="path4" d="M26.667 13.333h-5.333v5.333h5.333v-5.333zM25.333 17.333h-2.667v-2.667h2.667v2.667z"></path>
<path class="path5" d="M10.667 21.333h-5.333v5.333h5.333v-5.333zM9.333 25.333h-2.667v-2.667h2.667v2.667z"></path>
<path class="path6" d="M18.667 21.333h-5.333v5.333h5.333v-5.333zM17.333 25.333h-2.667v-2.667h2.667v2.667z"></path>
<path class="path7" d="M26.667 21.333h-5.333v5.333h5.333v-5.333zM25.333 25.333h-2.667v-2.667h2.667v2.667z"></path>
</symbol>
<symbol id="icon-shoes" viewBox="0 0 32 32">
<title>shoes</title>
<path class="path1" d="M29.268 2.693c-0.019-0.015-0.965-0.704-1.677 0.205-2.277 2.922-9.84 12.538-13.504 15.942-3.2 2.974-6.011 1.279-7.274 0.182v0.003c0 0-0.647-0.672-2.127-0.21-0.003 0.001-0.003 0.001-0.007 0.001-0.601 0.198-1.417 0.45-2.518 0.77-1.561 0.451-2.046 1.626-2.098 2.75 0.029 0.372 0.214 2.064 1.159 3.191 1.722 1.763 5.088 3.589 8.656 3.971 4.122 0.438 5.13-1.273 5.13-1.273s2.514-3.401 4.87-6.859c0.002-0.003 0.005-0.005 0.007-0.009 2.034-2.928 4.439-4.399 4.491-4.431 0.139-0.061 0.273-0.119 0.401-0.166 0.261-0.078 1.669-0.409 1.786 1.508l0.599 10.236 0.003 0.132c0 0 0 0.002 0 0.004l0.006 0.186c0.024 0.273 0.148 0.745 0.725 0.746 0.54-0.011 0.611-0.613 0.616-0.858v-0.105c0.219-2.672 1.177-12.605 2.064-14.415 3.011-6.893 0.314-10.225-1.308-11.499z"></path>
</symbol>
<symbol id="icon-skull" viewBox="0 0 32 32">
<title>skull</title>
<path class="path1" d="M9.345 27.63c0 1.285 1.041 2.326 2.326 2.326h8.722c1.285 0 2.326-1.041 2.326-2.326v-0.68c0-0.546 0.378-1.006 0.889-1.128 2.791-0.43 4.925-2.844 4.925-5.751 0-1.308-0.431-2.518-1.163-3.489v-3.977c0-5.832-5.077-10.56-11.339-10.56s-11.339 4.727-11.339 10.56v3.977c-0.732 0.971-1.163 2.181-1.163 3.489 0 2.907 2.134 5.321 4.925 5.751 0.512 0.122 0.89 0.581 0.89 1.128v0.68zM8.182 16c0-1.605 1.303-2.907 2.907-2.907s2.907 1.303 2.907 2.907c0 1.605-1.303 2.907-2.907 2.907s-2.907-1.303-2.907-2.907zM18.067 16c0-1.605 1.303-2.907 2.908-2.907s2.907 1.303 2.907 2.907c0 1.605-1.303 2.907-2.907 2.907s-2.908-1.303-2.908-2.907zM13.165 22.21l2.047-2.047c0.454-0.454 1.186-0.454 1.64 0l2.047 2.047c0.442 0.442 0.442 1.157 0 1.599s-1.157 0.442-1.599 0l-1.267-1.267-1.268 1.267c-0.441 0.442-1.157 0.442-1.599 0s-0.441-1.157-0-1.599z"></path>
</symbol>
<symbol id="icon-rocket" viewBox="0 0 32 32">
<title>rocket</title>
<path class="path1" d="M16 2.908c0 0-5.037 3.908-5.037 13.508 0 6.157 1.862 10.006 4.287 10.665v-6.197c0-0.414 0.335-0.75 0.75-0.75s0.75 0.336 0.75 0.75v6.197c2.425-0.657 4.287-4.508 4.287-10.665 0-9.711-5.037-13.508-5.037-13.508zM15.941 10.316c-0.864 0-1.709-0.078-2.457-0.219 0.732-2.361 1.765-3.95 2.526-4.88 0.758 0.918 1.786 2.495 2.514 4.857-0.777 0.157-1.667 0.242-2.582 0.242z"></path>
<path class="path2" d="M9.612 20.66c-1.504 0-2.722 1.041-2.722 2.324v6.109l4.931-3.648c-0.732-1.248-1.278-2.869-1.601-4.785h-0.608z"></path>
<path class="path3" d="M22.388 20.66h-0.608c-0.323 1.916-0.869 3.537-1.601 4.785l4.931 3.648v-6.109c-0-1.284-1.219-2.324-2.723-2.324z"></path>
</symbol>
</defs>
</svg>


  <div class="container">
    
<div class="breadcrumbs">
  <svg class="icon"><use xlink:href="#icon-burger"></use></svg>
  <ul>
    <li><a href="/">首页</a></li>
    
    
    <li>Ubuntu 下安装和配置 Homebrew</li>
    
  </ul>
</div>
<!-- /.breadcrumbs -->


    <article class="article">
  
  <header>
    
  
    <h1 class="title" itemprop="name">
      Ubuntu 下安装和配置 Homebrew
    </h1>
  


  </header>

  
  <div class="meta">
    
      <a class="date" href="/2016/03/17/homebrew-for-ubuntu/">
  <svg class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-office"></use></svg>
  <time datetime="2016-03-16T16:00:00.000Z" itemprop="datePublished">2016-03-17</time>
</a>

    
    
  <div class="category">
    <a class="category-link" href="/categories/code/">编码</a><a class="category-link" href="/categories/code/linux/">linux</a>
  </div>


    
  <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/ubuntu/">ubuntu</a></li></ul>


  </div>

  


  <div class="body">
  
    <p>由于在 Mac 上习惯了 brew 包管理器，使用 Ubuntu 时手痒，也想配置个 brew ，所以寻找了一下方法</p>
<a id="more"></a>
<h3 id="安装依赖"><a href="#安装依赖" class="headerlink" title="安装依赖"></a>安装依赖</h3><p>需要先 <strong>安装依赖</strong> (斜杆是命令多行)：</p>
<pre><code class="bash">sudo apt-get install build-essential curl git ruby libbz2-dev \libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
</code></pre>
<p>（注意上面的“\”，代表包文件名中有空格，必须贴着后面，因为这是一个转义模式）</p>
<h3 id="安装brew"><a href="#安装brew" class="headerlink" title="安装brew"></a>安装brew</h3><p>接着从 github 上把项目下载下来（这个过程要保证 github 访问通畅）：</p>
<pre><code class="bash">git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew
</code></pre>
<p>并将下列内容添加到 ~/.zshrc ($LD_LIBRARY_PATH 是共享目录，可能为空)：<br><strong>我用的是 Oh My Zsh，所以我编辑 .zshrc，如果你是其他的命令行请编辑对应配置文件</strong></p>
<h3 id="配置brew"><a href="#配置brew" class="headerlink" title="配置brew"></a>配置brew</h3><pre><code class="bash">export PATH=&quot;$HOME/.linuxbrew/bin:$PATH&quot;
export LD_LIBRARY_PATH=&quot;$HOME/.linuxbrew/lib:$LD_LIBRARY_PATH&quot;
</code></pre>
<p>然后执行：</p>
<pre><code class="bash">source ~/.zshrc
</code></pre>
<p>检查安装：<code>brew help</code></p>
<p>如果出错，可能是依赖未正确安装。</p>
<h3 id="常用命令"><a href="#常用命令" class="headerlink" title="常用命令"></a>常用命令</h3><pre><code class="bash">brew search  #搜索包
brew install  #安装包
brew uninstall  #删除包
brew list  #列出 pkg 的文件
brew info  #关于 pkg 的信息
brew update  #更新包
brew upgrade  #升级包
</code></pre>
<h3 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h3><ul>
<li><a href="https://linuxtoy.org/archives/linuxbrew.html" target="_blank" rel="external">Homebrew for Linux</a></li>
</ul>

  
  </div>

  
    
<nav class="article-nav">
  
    <a href="/2016/04/01/nodejs-for-ubuntu/" title="Ubuntu 下通过 brew 简单安装最新 nodejs 环境" class="newer">
      <em>Ubuntu 下通过 brew 简单安装最新 nodejs 环境</em>
    </a>
  
  
    <a href="/2016/03/16/ubuntu-disable-guest/" title="Ubuntu 禁用访客" class="older">
      <em>Ubuntu 禁用访客</em>
    </a>
  
</nav>


  

  
  <div class="donate-qrcode">
    <h3>如果您觉得内容对您的学习有所帮助，您可以请我喝咖啡~ （不喝无名的咖啡，请告诉我你是谁）</h3>
    <ul>
      <li><img src="/images/weixin-pay.jpg" alt="微信支付二维码" class="weixin-pay"></li>
      <li><img src="/images/ali-pay.jpg" alt="支付宝支付二维码" class="ali-pay"></li>
    </ul>
    <p>（手机微信下可以长按左图二维码，选择“识别二维码”输入金额）</p>
  </div>
  <!-- /.donate-qrcode -->
  

  

  

</article>

  </div>
  <!-- /.container -->

  <div class="sidebar">
  <header>
  <a href="/" class="mylogo">
    
      <img src="/images/edlad-web-logo-512.png" alt="ED少年" title="ED少年">
      <img src="/images/edlad-web-logo-min.png" alt="ED少年" title="ED少年">
    
  </a>
  
  <h2>记录从学习前端开发到放弃的整个康复过程</h2>
  
</header>

  <nav class="navigation" id="navigation">
    
      <a title="首页" href="/">
        <svg class="icon"><use xlink:href="#icon-hospital"></use></svg><em>首页</em>
      </a>
    
      <a title="编码" href="/categories/code/">
        <svg class="icon"><use xlink:href="#icon-bug"></use></svg><em>编码</em>
      </a>
    
      <a title="生活" href="/categories/life/">
        <svg class="icon"><use xlink:href="#icon-costumes"></use></svg><em>生活</em>
      </a>
    
      <a title="作者" href="/author/">
        <svg class="icon"><use xlink:href="#icon-skull"></use></svg><em>作者</em>
      </a>
    
      <a title="友链" href="/friend/">
        <svg class="icon"><use xlink:href="#icon-nature"></use></svg><em>友链</em>
      </a>
    
  </nav>
  <nav class="mobile-navigation" id="mobile-navigation">
    <button><span>Menu</span></button>
    <!--
    <select>
      
      <option value="/">首页</option>
      
      <option value="/categories/code/">编码</option>
      
      <option value="/categories/life/">生活</option>
      
      <option value="/author/">作者</option>
      
      <option value="/friend/">友链</option>
      
    </select>
    -->
  </nav>
  <footer>
  <p>
    <a href="/atom.xml" target="_blank">
      <svg class="icon"><use xlink:href="#icon-doctors"></use></svg><em>RSS订阅</em>
    </a>
    |
    <a href="/sitemap.xml" target="_blank">
      <svg class="icon"><use xlink:href="#icon-shoes"></use></svg><em>网站地图</em>
    </a>
  </p>
  <p>Proudly powered by <a href="http://hexo.io/" target="_blank">Hexo</a></p>
  <p>Designed by <a href="">Eded Wang</a></p>
  <p>Copyright&copy; 2017 <a href="">ED少年</a></p>
  
  <p>闽ICP备16010082号</p>
  
</footer>

</div>
<!-- /.navigation -->

  <div id="retop" class="retop">
  <svg class="icon"><use xlink:href="#icon-rocket"></use></svg>
</div>


  <div class="mobile-nav" id="mobile-nav">
    <ul>
      
      <li>
        <a href="/">
          <svg class="icon"><use xlink:href="#icon-hospital"></use></svg>
          <em>首页</em>
        </a>
      </li>
      
      <li>
        <a href="/categories/code/">
          <svg class="icon"><use xlink:href="#icon-bug"></use></svg>
          <em>编码</em>
        </a>
      </li>
      
      <li>
        <a href="/categories/life/">
          <svg class="icon"><use xlink:href="#icon-costumes"></use></svg>
          <em>生活</em>
        </a>
      </li>
      
      <li>
        <a href="/author/">
          <svg class="icon"><use xlink:href="#icon-skull"></use></svg>
          <em>作者</em>
        </a>
      </li>
      
      <li>
        <a href="/friend/">
          <svg class="icon"><use xlink:href="#icon-nature"></use></svg>
          <em>友链</em>
        </a>
      </li>
      
    </ul>
  </div>
  <!-- /.mobile-nav -->
  <div class="shade" id="shade"></div>
  <!-- /.shade -->

  

  
    <script>
    (function(){
        if( location.hostname == "localhost" ) { return; }

        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        bp.src = curProtocol === 'https'
          ? 'https://zz.bdstatic.com/linksubmit/push.js'
          : 'http://push.zhanzhang.baidu.com/push.js';
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
    </script>
  

  <script src="/js/instantclick.min.js" data-no-instant></script>
  <script src="/js/jquery.min.js"></script>
  <script src="/js/prism.js"></script>
  <script src="/js/main.js" data-no-instant></script>

  
    <script src="//s4.cnzz.com/z_stat.php?id=1259789287&web_id=1259789287" data-no-instant></script>
  
  

</body>
</html>
